var util = require('../../utils/common.js'); //引入公共JS 


Page({
  data: {
    showIcon: true,
    //显示返回键以及首页
    idSelect: true,
    showMessage: false,
    changeText: "请选择退票原因"
  },
  onLoad: function (options) {
    console.log(options);
  },
  changeOpen: function () {
    //点击查看列车时刻表
    this.setData({
      idSelect: false
    });
  },
  changeClose: function () {
    //点击查看列车时刻表
    this.setData({
      idSelect: true
    });
  },
  idSelect: function (e) {
    this.setData({
      changeText: e.currentTarget.dataset.text,
      idSelect: true
    });
  },
  changeSubmit: function () {
    if (this.data.changeText == "请选择退票原因") {
      this.showMessage('请选择退票原因');
    }
  },
  showMessage: function (text) {
    var that = this;
    that.setData({
      showMessage: true,
      messageContent: text
    });
    setTimeout(function () {
      that.setData({
        showMessage: false,
        messageContent: ''
      });
    }, 3000);
  }
});